#include <iostream>
using namespace std;
#include "tdlexcept.h"
using namespace tdl;

TDL_DECLARE_EXCEPTION(my_ex);

void foo1() throw(my_ex)
{
	throw my_ex("ex_1 info");
}

void foo2() throw(my_ex)
{
	throw my_ex("ex_2 info", 1, true);
}

int main(int argc, char* argv[])
{
	try {
		foo1();
	} catch(my_ex& ex) {
		cerr << TRACE_INFO() << ex.what() << endl;
	}

	try {
		foo2();
	} catch(my_ex& ex) {
		cerr << TRACE_INFO() << ex.what() << "|errcode = " << ex.get_errcode() << endl;
	}

	tdl_assert(sizeof(int) == sizeof(long long int));

	return 0;
}

